package org.example.helloworld.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.example.helloworld.entity.ElcPri;
import org.example.helloworld.mapper.ElcPriMapper;
import org.example.helloworld.service.IElcPriService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 电费价格 服务实现类
 * </p>
 *
 * @author cwf
 * @since 2024-07-10
 */
@Service
public class ElcPriServiceImpl extends ServiceImpl<ElcPriMapper, ElcPri> implements IElcPriService {
    @Autowired
    private ElcPriMapper elcPriMapper;

    @Override
    public IPage<ElcPri> getElcPriList(Page<ElcPri> page, String search) {
        QueryWrapper<ElcPri> queryWrapper = new QueryWrapper<>();
        if (search != null && !search.isEmpty()) {
            queryWrapper.like("stemp", search);
        }
        return elcPriMapper.selectPage(page, queryWrapper);
    }
}
